|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmontecarlo.Game
public class Game
Class containing logic for a two-player, two-action discrete game of complete information. Data fields contain information on utilities, payoffs, and equilibria associated with the game. Contains methods to generate utilities, calculate equilibria, calculate probabilities and moments, and simulate outcomes. This class represents a game of entry with two players. Outcomes are indexed from 0 to 3, corresponding to both enter, only player 1 enters, only player 2 enters, and both enter respectively.
Constructor Summary | |
---|---|
Game(double[] x,
long randomSeed)
Primary constructor for a 2-by-2 game. |
Method Summary | |
---|---|
Jama.Matrix |
getMoments(double[] x,
java.util.ArrayList<Game> importanceGamesList)
Return GMM moments, as defined by matching the empirical frequency of an outcome to the probability predicted by the model. |
int |
getOutcome()
Returns index of simulated outcome. |
void |
setOutcome(int outcome)
Sets index of simulated outcome. |
int |
simulateOutcome(double[] x)
Simulates an outcome of the game. |
void |
updateMoments(Jama.Matrix moments,
double[] x,
java.util.ArrayList<Game> importanceGamesList)
Method to update moment vector, starting with an extant moment vector and adding to it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Game(double[] x, long randomSeed)
x
- Vector of primitives associated with the game.randomSeed
- Seed for the random-number generator.Method Detail |
---|
public Jama.Matrix getMoments(double[] x, java.util.ArrayList<Game> importanceGamesList)
x
- Vector of unknown parameters.importanceGamesList
- ArrayList of importance games used in importance sampler.
public void updateMoments(Jama.Matrix moments, double[] x, java.util.ArrayList<Game> importanceGamesList)
moments
- Passed Jama.Matrix to add the current set of moments to.x
- Vector of unknown parameters.importanceGamesList
- ArrayList of importance games used in constructing the probabilities.public int simulateOutcome(double[] x)
x
- Vector of unknown parameters.
public int getOutcome()
public void setOutcome(int outcome)
outcome
- The index of the outcome to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |